<extend name="common/common" />

<block name="title"><title>仟途旅游—旅游攻略</title></block>

<block name='css'>
    <link rel="stylesheet" href="__PUBLIC__/css/style.css">
    <link rel="stylesheet" href="__PUBLIC__/css/strategy.css">
    <style>
        .footer {
            background-color: #505050;
            padding: 30px 0 10px;
        }
    </style>
</block>

<block name="content">
    <div class="section-preview" id="content">
        <div class="container">
            <div class="row">

            </div>
        </div>
        <div class="container" align="center" style="display: block;">
            <ul class="pagination" id="pagination">
                <!-- Pages-->
            </ul>
        </div>

    </div>
    <div id="temp" style="display: none">
        <div  class="col-lg-4 col-sm-6" >
            <div class="preview">
                <div class="image">
                    <a href="#" rel="nofollow" >
                        <img style="width: 360px;height: 230px" src="" class="img-responsive" alt="">
                    </a>
                </div>
                <div class="options">
                    <h3></h3>
                    <p></p>
                    <div class="btn-group">
                        <a href="#" class="btn btn-info">More Info</a>
                    </div>
                </div>
            </div>
        </div>

    </div>

    <div id="temp1"  style="display: none">
        <div class="blog-leftgrids">
            <div class="image group">
                <div id="strategy_box">
                    <div class="grid images_3_of_1">
                        <a href=""><img src=""></a>
                    </div>
                    <div class="grid span_2_of_3">
                        <h3>这是游记1</h3>
                        <h4></h4>
                        <p>这是游记1 </p>
                        <span><a href="" class="btn btn-primary">查看详情</a></span>
                    </div>
                </div>
            </div>

        </div>
    </div>

</block>

<block name="js">
    <script>
        fixFooter();
        var fetchData = function(furl){
            if(furl==null){
                url = '{:U(\'Strategy/getStrategyList\')}';
            }else{
                url = furl;
            }

            $.ajax({
                url:url,
                type:'GET',
                dataType:'json',
                data:{
                }, success:function(json){
                    if(json.state!='1'){
                        alert("出错了");
                        return;
                    }

                    var show = json.show;
                    if(show == "" || show.total == 0){
                        $('.row').html('<p align="center">没有找到记录!!</p>');
                        $('.pagination').html("");
                        return;
                    }else{
                        //列表渲染
                        var list = json.data;
                        var $template_list_tbody = $('#temp1');
                        var template_render = '';

                        for(var i in list){

                            $('#temp1 img').attr('src','__PUBLIC__/uploads/strategyImage/'+list[i].img_url);
                            $('#temp1 h3').html(list[i].name);
                            $('#temp1 h4').html('<span class="glyphicon glyphicon-time">&nbsp;</span>'+list[i].starttime);
                            $('#temp1 p').html('<span class="glyphicon glyphicon-user">&nbsp;</span>'+list[i].company);
                            $('#temp1 a').attr('href','{:U(\'Strategy/readStrategy\')}?id='+list[i].id);
                            template_render += $template_list_tbody.html();
                        }

                        $('.row').html(template_render);

                    }
                    make_page(json.show,'.pagination','?');
                    $('html,body').animate({'scrollTop':0},300);
                }
            })
        }

        fetchData();

        $('.st').addClass('active1');
        $('.hp').removeClass('active1');
        $('html,body').animate({'scrollTop':0},300);
    </script>
</block>

